// clicking the link sends the request and removes the container it was in or shows and error in it's place
$(document).on('click', 'a.remove_container', function() {
  var $link = $(this);
  var $container = $link.closest($link.data('remove-container'));
  $container.html('<center><%= image_tag "ajax-loader.gif" %></center>');

  $link.bind('ajax:success', function(){
    $container.html('Done!');
    $container.hide('slow');
  }).bind('ajax:error', function(){
    $container.html("Error");
  });
});
